UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '05PgCuiWHuvyD5suMcJ/jA3QeqDFkvTI97+djkt8vZ8='
WHERE
key_id = '544edbb302e715600e835953530dfb05af3fb2c3fb89b56f96fcd7487f078ae6'
AND (
token = '05PgCuiWHuvyD5suMcJ/jA3QeqDFkvTI97+djkt8vZ8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)