UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'MGXlrjEhEskFBE2qWaSQo5rmzHyONudCTwAddqr2440=' 
WHERE 
  key_id = '015da63ab6eddad946282ad3fdace94415cfa13e0bbda76ca6d87b1435a66e37' 
  AND (
    token = 'MGXlrjEhEskFBE2qWaSQo5rmzHyONudCTwAddqr2440=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030