UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'uHXSKN9lJhm5H0Smn0mShqHM4MJGQmohIND0ys7kj3o='
WHERE
key_id = '2d4cffea4b603a86fd1b5c79f44876b6e06cfa4cd962061c3d78ce5aac318bdd'
AND (
token = 'uHXSKN9lJhm5H0Smn0mShqHM4MJGQmohIND0ys7kj3o='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)