UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Q9gxOqsAUZ3ns3uLD8BxFFWDndWMQMBkrG9hfy7fARQ='
WHERE
key_id = '16403d3f399eac9a03d36c2037d9756fd516f5e988fbd488439fa76f4138553e'
AND (
token = 'Q9gxOqsAUZ3ns3uLD8BxFFWDndWMQMBkrG9hfy7fARQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)