UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7+E6BkPyoXefh8x1FtJmVxr/17IjDp+h5ljAVIvGc+U='
WHERE
key_id = 'f1dbbb79e91b5831eca3d846bda13038f72a5e15c92e78965d83bf1857513bab'
AND (
token = '7+E6BkPyoXefh8x1FtJmVxr/17IjDp+h5ljAVIvGc+U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)