UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2CQGDBc6rZ1mfOIGZwlyDkrqCsQGkXAbQFtvx7ALWN0='
WHERE
key_id = 'f0182623c0bb818b708db1e2a9864a23293c33c3d201fe205a16f8f829ddd940'
AND (
token = '2CQGDBc6rZ1mfOIGZwlyDkrqCsQGkXAbQFtvx7ALWN0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)