UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'kLCLxmElTJMI5xWyOePDwApUJTMjAn8xUtBpgawdOP8='
WHERE
key_id = '5899827afa18cd09132fbdccc81ff2348f13204c3b7065bdae17af4eede53bb3'
AND (
token = 'kLCLxmElTJMI5xWyOePDwApUJTMjAn8xUtBpgawdOP8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)