UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ljHUjnqRftg7ZbhORS/fMRJN3uxvYj4KHDrb63xX3gM='
WHERE
key_id = 'eb877d6ec17cd80dbb81fb402173c244af42ee3c0832a01e15a3557f89057411'
AND (
token = 'ljHUjnqRftg7ZbhORS/fMRJN3uxvYj4KHDrb63xX3gM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)