UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'AMgx0XHDAWmhmZ5YRgPXfDPiffj6FrXO+3k7uJI8m7A=' 
WHERE 
  key_id = 'db8b1963f7fc7b88917ea15d728fdbaf29d76dab887bc455ebfca6b77f7bd5c0' 
  AND (
    token = 'AMgx0XHDAWmhmZ5YRgPXfDPiffj6FrXO+3k7uJI8m7A=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020