UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'nSFLedWcnieQIge3tF5+LSJtaaqQQ5JkK7PAYKR/DYU=' 
WHERE 
  key_id = '7f86dd5d91001f72077b951e9f9e33cf6f2c0ec07430474c2290d9d8f2551a93' 
  AND (
    token = 'nSFLedWcnieQIge3tF5+LSJtaaqQQ5JkK7PAYKR/DYU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027