UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'IQ6deYybwJ+5frzydp0dCaSCtlFJi8yU+FmkJuGFwIg='
WHERE
key_id = '000b7d472e592d2bb1f7ab101ad466f6aa4b5784210333ae6c6580def6b0d2cf'
AND (
token = 'IQ6deYybwJ+5frzydp0dCaSCtlFJi8yU+FmkJuGFwIg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)