UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'OiOhiJ/xHEzb+PTyKITbH1h1zTRWr8YUrlJ+EHOjUdI='
WHERE
key_id = '1e355ef3436364de31689ed65c0e9712e56d865aa59703633479aa92277e9962'
AND (
token = 'OiOhiJ/xHEzb+PTyKITbH1h1zTRWr8YUrlJ+EHOjUdI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)