UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+cJi1iRtUTCsFkqjrYwoWwlqPFp6XOZ+AKCTKUcH6Bs='
WHERE
key_id = '6dcd2ff1cb81d9f0c3916f0db40cdcc8137c6ca64e0713b49fdfd8ab2223e997'
AND (
token = '+cJi1iRtUTCsFkqjrYwoWwlqPFp6XOZ+AKCTKUcH6Bs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)