UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1An6WouHqdCQQ2VhGXswtHEofcFgDLvpIFX6Rd+OdKo='
WHERE
key_id = 'db6e1dca88df46bd5a45cb4d0a5d5cf84a48d2b1a852b04efe6ab03b8835c26f'
AND (
token = '1An6WouHqdCQQ2VhGXswtHEofcFgDLvpIFX6Rd+OdKo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)