UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Rl7OQYk4Z6fTnf5fQT644FULXFSzb/p5coogjs+b2P4='
WHERE
key_id = '15014ca1867db8479c2f0f39a00d6dcd5e2702b68b35215dddebcea0b4c27c32'
AND (
token = 'Rl7OQYk4Z6fTnf5fQT644FULXFSzb/p5coogjs+b2P4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)