UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'd1yxmqS2u5+okm3Kich4wx1GJd9nNpFVPmwTxpDco0s='
WHERE
key_id = '1eb77c761a37056a82419ccce72fd2e0bcb0112b3bec786a93e45fb1c8ffca11'
AND (
token = 'd1yxmqS2u5+okm3Kich4wx1GJd9nNpFVPmwTxpDco0s='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)