UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'YGqKuyOkHWQbMuAl0f+fqWxZ6LCpAu5VQbNvRoU18QI=' 
WHERE 
  key_id = '135dcd0054dcbc8e3173294ff97182b01843d2424773f14a4e51fda3024ceaa5' 
  AND (
    token = 'YGqKuyOkHWQbMuAl0f+fqWxZ6LCpAu5VQbNvRoU18QI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036