UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/OssUuiALbaQvrlYqRoBSJWmZaMdrVOmR9EuaI1a6hM='
WHERE
key_id = '56a70ff682990b50a3eeee8ddb0c9b947f41163dda2f1b88eb9c9177edb4f316'
AND (
token = '/OssUuiALbaQvrlYqRoBSJWmZaMdrVOmR9EuaI1a6hM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)