UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'G46Ju416ibogIdXG+6aUfU1PuZ6emvjQ7N3T34LliGU='
WHERE
key_id = '05f81a04a564e493d8003ff3d7e556bf6160aa9850533e13fa95f4fb92ab5ab7'
AND (
token = 'G46Ju416ibogIdXG+6aUfU1PuZ6emvjQ7N3T34LliGU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)