UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/Fvem3oZBoH7HNofAbCxFuzxK0QuH41OYriALBh27nE=' 
WHERE 
  key_id = 'e4b437a9f52bd5f39db196902edc8586ac577693d6b6a9253c225d9d9c1cdedd' 
  AND (
    token = '/Fvem3oZBoH7HNofAbCxFuzxK0QuH41OYriALBh27nE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030