UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/9op/yslR75trAj3Iamv+UKixEm6wveg/wHmBdH4IK0='
WHERE
key_id = 'b9250532cf23cedb53d4abcd20454bbf39eb9f907255ab606914b55b14ba2c73'
AND (
token = '/9op/yslR75trAj3Iamv+UKixEm6wveg/wHmBdH4IK0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)