UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'fwLf5+1SwnhfOkt6FUKTnsFkqTEvpDaGhgz/l03m+Zs='
WHERE
key_id = '9e24e407625a0efa6ded59aaed9855bbaa8ce5372ba06b7507171930ca74c49b'
AND (
token = 'fwLf5+1SwnhfOkt6FUKTnsFkqTEvpDaGhgz/l03m+Zs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)