UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ENun9jNjg/x3TYgPYWePr9/iRbHsmrCS9bSBjw48L0w=' 
WHERE 
  key_id = '28681573cc4280de98e4ba435a92a5a03c2679f7438e5c6027e70c327689aef0' 
  AND (
    token = 'ENun9jNjg/x3TYgPYWePr9/iRbHsmrCS9bSBjw48L0w=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035