UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3TlzcINa32bpgLp6d1b9fN2j4ZSpNW6s4iPeCfQsV7w='
WHERE
key_id = '935e1684f71a0b59aea864234bddcb160d57f0e970920c2c087d025a2d6d407c'
AND (
token = '3TlzcINa32bpgLp6d1b9fN2j4ZSpNW6s4iPeCfQsV7w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)