UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8R+RoWI6PXXNIeuZN4tNC5oFHs/wYLVgOw4ePjwTBtY='
WHERE
key_id = '80ba4639a6672e989159b6810061d9aab683f488f506830a1621eed364f44575'
AND (
token = '8R+RoWI6PXXNIeuZN4tNC5oFHs/wYLVgOw4ePjwTBtY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)