UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+6zQqVXbp9S2bOeWJH12rfmU9THDg6+hZAMrEfNcJ2A=' 
WHERE 
  key_id = '86be358e7c2b76780ab963269f4d26673da0bf404b6d5be6a6522c2c82421e47' 
  AND (
    token = '+6zQqVXbp9S2bOeWJH12rfmU9THDg6+hZAMrEfNcJ2A=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031