UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/Q/NwULu1NSGcNA+Md5wkHuMS54j7YTBJPHOsIO7pp8='
WHERE
key_id = '9b6b5fcdafe1e36dced5716578d3ce73bb2f93589cf8e8f3d7056b60fe82f653'
AND (
token = '/Q/NwULu1NSGcNA+Md5wkHuMS54j7YTBJPHOsIO7pp8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)