UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'a3YxiJ/LRncFwgTIP9G6VxFZ2PwxrEpPvQp4RPWhquQ=' 
WHERE 
  key_id = 'dd194b6f2ec83a4103e5a25cfa343f1820fc995ab2030c0555e0c269e78b5dc3' 
  AND (
    token = 'a3YxiJ/LRncFwgTIP9G6VxFZ2PwxrEpPvQp4RPWhquQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029