UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9IjNtJ1iR/EVrbGSyLw3BK86py/TP9AXEYXvMNWr300='
WHERE
key_id = 'd5345436272fbf825e620c9e085cc0cc148183cc3f5f5ac46ab36656d169f5a8'
AND (
token = '9IjNtJ1iR/EVrbGSyLw3BK86py/TP9AXEYXvMNWr300='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)