UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'aQHQd6hf5rB47I6Hd5WwGWUQ3+/7wEiH8F1VvEWCLPo=' 
WHERE 
  key_id = '0f1ab3141ea6d163d30109585d6e4ceefa6e465e93adc62ff1d7a61a2c511a8c' 
  AND (
    token = 'aQHQd6hf5rB47I6Hd5WwGWUQ3+/7wEiH8F1VvEWCLPo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030