UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'adn2fKObXI3XclgOmp9x7/bSDYruSveSYdxnJc/Vyjg='
WHERE
key_id = 'c6d2c567c35fd86c5e09a9b3429f73ffde3247f23ed47eafea4d7c893979e740'
AND (
token = 'adn2fKObXI3XclgOmp9x7/bSDYruSveSYdxnJc/Vyjg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)