UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'C2oYPQ4PpHoOSUZBFDlNwj3Wr5gOpv3YuvrbgfjcOaQ='
WHERE
key_id = 'dc4c95d5df08eed2d35b111117f80523602ad26635ad1b4506020dfc3849dd47'
AND (
token = 'C2oYPQ4PpHoOSUZBFDlNwj3Wr5gOpv3YuvrbgfjcOaQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)