UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'LmbtzX7AQzu2Sggiqp4RZHIvJj9bgtLv2V2HvJI6HQg=' 
WHERE 
  key_id = '58332f6d372afda3b1831b7a5a511ba67ae93fc9d990957a7ba2720b2a278e91' 
  AND (
    token = 'LmbtzX7AQzu2Sggiqp4RZHIvJj9bgtLv2V2HvJI6HQg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036