UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2eHWJHWu8SIxxnF8S8iD24Ccu+XLFDMQtgQOeVG4sa0='
WHERE
key_id = 'ced6c0fd38d404c5c6fbf8edf8b00517fa8b7103f8e3b9e6927e404003007f5a'
AND (
token = '2eHWJHWu8SIxxnF8S8iD24Ccu+XLFDMQtgQOeVG4sa0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)