UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'RQwW8Lj7VSlyu9Z2uQHYPDN+23hXoXTkobgICs9m6I8='
WHERE
key_id = '65cb3f36ca174a0d44b34ff43dddc882684bb3de028121288ccfe5a9f47adaa2'
AND (
token = 'RQwW8Lj7VSlyu9Z2uQHYPDN+23hXoXTkobgICs9m6I8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)