UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'FpHmYLxzTppcACXKpQNi+gOWuMt2nohvbIzAy08Hvmc='
WHERE
key_id = 'afe5834be3bca918f69adaeacb50b972603b2dda23ee5a535707e0f3da4a5a0f'
AND (
token = 'FpHmYLxzTppcACXKpQNi+gOWuMt2nohvbIzAy08Hvmc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)