UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'R3mmd/7rJe63HQRKlDPVYJ1oOtm7B3A0G9qs8nRWjmU='
WHERE
key_id = '2b667a4da611fcc933b0ff0fa5df9efae483efb88e367f64698c66346a0d2199'
AND (
token = 'R3mmd/7rJe63HQRKlDPVYJ1oOtm7B3A0G9qs8nRWjmU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)