UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'sPQ+6fCE0SzaRYcVUVXZ+6u5B9X6XAjlREAT7dOkQnA='
WHERE
key_id = 'ff97eccb82db4bba80abce2bbf59762879bd009ab8870e8ceac7b6d697dd5275'
AND (
token = 'sPQ+6fCE0SzaRYcVUVXZ+6u5B9X6XAjlREAT7dOkQnA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)