UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'LXOKz3V0MH9RJUjCVwYNKGf+0ZXN/TC2uOFyLScYrrc=' 
WHERE 
  key_id = 'f646981e8740fc0197f8c42149e74b238d954cea59e781e5910bceae670a8a8f' 
  AND (
    token = 'LXOKz3V0MH9RJUjCVwYNKGf+0ZXN/TC2uOFyLScYrrc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028