UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'iOS85LAwN6cpMIhfi4DuqEBbfpxRiREtw9OLDWjzkew=' 
WHERE 
  key_id = 'f08446f8eea8bfc538647fd03bfb9e43503aa2ce3391c5b0c15cb16baa9f2d1d' 
  AND (
    token = 'iOS85LAwN6cpMIhfi4DuqEBbfpxRiREtw9OLDWjzkew=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024