UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qdbhQJMjaPojqReOiHZhIoo6qxJOiM/cyBPRRjgIYeQ='
WHERE
key_id = '0b42f12a340b51c37a1fe36db4b798dbdf157883386b87607274ba7d4efc2136'
AND (
token = 'qdbhQJMjaPojqReOiHZhIoo6qxJOiM/cyBPRRjgIYeQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)