UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'CswaQGMBmAlCWoK1vJr1/Y17dRqdIf0JvrqRpZRHgWE='
WHERE
key_id = 'debacf32bf983a42eb955c06d8c207e70176cc9f06b3ec7f270fd31db442fbd2'
AND (
token = 'CswaQGMBmAlCWoK1vJr1/Y17dRqdIf0JvrqRpZRHgWE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)