UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'H2h2oGZ8kyVNPGVrqnzpbWr0V6vAJVm3vmpdVZwgAxc='
WHERE
key_id = '0c2546542650c14962aec675ac80a7257d3ba9fd6a64f473211a1427e27c289b'
AND (
token = 'H2h2oGZ8kyVNPGVrqnzpbWr0V6vAJVm3vmpdVZwgAxc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)