UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '9lSi3w20OI1uaBjux3D9jZ9H3NJMq34x8ukJzamyV/0=' 
WHERE 
  key_id = '08e6bee03335be5350188417e092decf0e8348c9fc8a038a1f570e47e2ab29aa' 
  AND (
    token = '9lSi3w20OI1uaBjux3D9jZ9H3NJMq34x8ukJzamyV/0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036