UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2kANigTcKJZ34dwaF/y8R5c39jQ4lXli3su6yLNsn/k='
WHERE
key_id = 'b18add402d06938cb6f16d1a626cc7b190c568101af8f26d1c7144685647844c'
AND (
token = '2kANigTcKJZ34dwaF/y8R5c39jQ4lXli3su6yLNsn/k='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)