UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '33wkE0JruYJV8RJYSdFVCID2Z6BSb1zCELP/QMl5b94='
WHERE
key_id = 'cc6c1dcb3dc6714430256ee3fa00ac742d0277039cc7ed876cf55c863c84e061'
AND (
token = '33wkE0JruYJV8RJYSdFVCID2Z6BSb1zCELP/QMl5b94='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)