UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'k/DVxOVrqEgRNfxNC7DD5kP0l59g5moUAL95MUjGW94='
WHERE
key_id = 'bc3149358b83f4f4dba2e5e79a0c4033f14afa206fffd188bd826de9d0854e4d'
AND (
token = 'k/DVxOVrqEgRNfxNC7DD5kP0l59g5moUAL95MUjGW94='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)